namespace Tekdev.InputValidation
{
    using System;
    using System.Collections;
    using System.Reflection;

    [Serializable]
    internal class QueryStringPageCollection : CollectionBase
    {
		#region Constructor
        internal QueryStringPageCollection()
        {
        }
		#endregion

		#region CollectionBase Methods
		internal QueryStringPage this[int index]
		{
			get { return (QueryStringPage) List[index]; }
			set { List[index] = value; }
		}

		internal QueryStringPage this[string url]
		{
			get { return Find(url); }
		}
		
		internal int Add(QueryStringPage parameter)
        {
            return List.Add(parameter);
        }

        internal void Remove(QueryStringPage parameter)
        {
            List.Remove(parameter);
        }
		#endregion

		#region Custom Methods
		internal QueryStringPage Find(string url)
		{
			for (int i = 0; i < Count; i++)
			{
				QueryStringPage currentItem = (QueryStringPage)List[i];
				if (string.Compare(currentItem.Url, url, true) == 0)
				{
					return currentItem;
				}
			}
			return null;
		}
		#endregion
    }
}

